package at.com.vn.chess.dao;


import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;

import at.com.vn.chess.entity.Room;


public class RoomDao extends BaseDao {

	/** Getting the Session Factory and session */
	private Session sess = null;

	public RoomDao() {
		super();
		sess = super.getSess();
	}

	@SuppressWarnings( "unchecked" )
	public List<Room> findAllRoom() {
		return sess.createQuery("from Room").list();
	}

	@SuppressWarnings( "unchecked" )
	public List<Room> findRoom(Integer roomId) {
		Query q = sess.createQuery("from Room where room_id = :roomId ");
		q.setParameter("roomId", roomId);
		return q.list();
	}
}